package com.zlcx.tz.live.common.config;

import com.zlcx.tz.live.utils.P6SpyLogger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import java.util.List;

/**
 * @author anjl
 */
@Configuration
public class P6SpyConfig {
    /**
     * 超时sql, 超时后邮件报警
     */
    public static final long timeout = 1000;
    /**
     * P6间谍配置
     *
     * @param print      是否打印
     * @param containSql 包含Sql  select ,update ,delete, insert
     */
    public P6SpyConfig(@Value("${p6spy.print:null}") Boolean print, @Value("#{'${p6spy.containSql:select,update,delete,insert}'.split(',')}") List<String> containSql) {
        P6SpyLogger.print = print;
        P6SpyLogger.containSql = containSql.contains("") ? null : containSql;
    }
}